package core.models;
import java.util.ArrayList;
import java.io.Serializable;

/** 
 * @author 4c1a
 *
 */
public class Road implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int prevLocation;
	private Places place;
	
	public Road()
	{
		prevLocation = 0;
		place = Places.Trail;
	}
	
	public Places getPlace()
	{
		return place;
	}
	
	public void setPlace(Places place)
	{
		this.place = place;
	}
	public void updatePlaces(int distTraveled)
	{
		if (prevLocation < 100 && distTraveled >= 100)
		{
			place = Places.Store;
			prevLocation = distTraveled;
		}
		else if(prevLocation < 300 && distTraveled >= 300)
		{
			place = Places.Store;
			prevLocation = distTraveled;
		}
		else if(prevLocation < 500 && distTraveled >= 500)
		{
			place = Places.River;
			prevLocation = distTraveled;
		}
		else if(prevLocation < 600 && distTraveled >= 600)
		{
			place = Places.Store;
			prevLocation = distTraveled;
		}
		else if(prevLocation < 900 && distTraveled >= 900)
		{
			place = Places.Store;
			prevLocation = distTraveled;
		}
		else if(prevLocation <1200 && distTraveled >= 1200)
		{
			place = Places.Store;
			prevLocation = distTraveled;
		}
		else if(prevLocation < 1500 && distTraveled >= 1500)
		{
			place = Places.End;
			prevLocation = distTraveled;
		}
		else
		{
			place = Places.Trail;
			prevLocation = distTraveled;
		}
	}
}